home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
morse
/
bunn41ta
/
n4lta.asm
< prev
next >
Wrap
Assembly Source File
|
1994-09-02
|
3KB
|
152 lines
;This is a very simple program
;to transmit a morse code
;message with a PIC 16C54
;microcontroller. The morse
;message is constructed by
;calling subroutines that
;sends dits,dahs, and spaces
;
;START OF PROGRAM
;Set the device type,osc type,WDT status
;and code protect status
DEVICE PIC16C54,rc_OSC,WDT_OFF,PROTECT_OFF
RESET start ;vector to
;here on
;reset
Count0 equ 10h
Count1 equ 11h ;CW Speed
;timing bytes
;labels
Start mov !RA,#10000000b ;set bit7
;as an input
;bit for
;future use
call WDSPC ;wait 1 word
;space and
CALL DAH ;then send
;the message
CALL DIT ;by calling
;the appropriate
CALL DIT ;dits and
CALL LETSPC ;dahs. The dits
;and dahs have
CALL DIT ;have spacing
;built in
CALL WDSPC ;DE
CALL DAH
CALL DIT
CALL LETSPC ;N
CALL DIT
CALL Dah
CALL Dah
CALL Dah
CALL DAH
CALL LETSPC ;1
CALL DIT
CALL Dit
CALL Dah
CALL DIT
CALL LETSPC ;F
CALL DAH
call dit
call dit
call dit
CALL LETSPC ;B
CALL WDSPC
CALL WDSPC
CALL WDSPC ;WAIT
;for 3
;word spaces
;and jump
jmp start ;to the
;beginning
;to repeat
;the message
;DITIME is a routine that
;generates a one dit timing
;delay
DITIME
mov Count1,#00100000b
:Loop djnz Count0,:Loop
djnz Count1,:Loop
ret
;LETSPC generates a letter space
;delay
LETSPC call DITIME
call DITIME
call DITIME ;wait 3 ditimes
ret
;WDSPC generates a word space
;delay
WDSPC call DITIME
call DITIME
call DITIME
call DITIME
call DITIME
call DITIME
call DITIME ;wait 7 ditimes
ret
;DIT sends a dit and waits 1
;morse space
DIT or RA,#00000011b ;set bit0 and bit1
;on
call DITIME
and RA,#00000000b ;turn them off
call DITIME ;wait 1 ditime
ret
;DAH sends a dah and waits one
;morse space
DAH or RA,#00000011b ;Bits 1,0 on
call DITIME
call DITIME
call DITIME ;wait 3 dits
and RA,#00000000b ;turn off
call DITIME ;wait 1 ditime
ret
;End of the program
;written by P Bunn, N4LTA
;